from django.db import models
from apps.common.base.models import BaseModel
from apps.system.lessee.models import Lessee
from apps.account.models import Account
from apps.system.role.models import Role

class Admin(BaseModel):

    lessee = models.ForeignKey(Lessee, related_name="lessee_admin", verbose_name='租户', on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)
    account = models.ForeignKey(Account, related_name="account_admin", verbose_name='账号', on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)
    role=models.ForeignKey(Role, related_name='role_admin', verbose_name='角色', on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)
    phone = models.CharField("手机号", max_length=200, blank=True, null=True, default='')
    nickname = models.CharField("昵称", max_length=200, blank=True, null=True, default='')
    realname = models.CharField("姓名", max_length=200, blank=True, null=True, default='')
    status = models.IntegerField("状态", blank=True, null=True, default=1)

    class Meta:
        verbose_name = 'Admin'
        verbose_name_plural = verbose_name
